<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Selenium IDE Test</title>
    <link rel="stylesheet" type="text/css" href="chrome://selenium-ide/content/jsunit/css/jsUnitStyle.css">
		<script type="text/javascript" src="chrome://selenium-ide/content/selenium-core/lib/prototype.js"></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/selenium-core/scripts/htmlutils.js"></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/selenium-core/scripts/atoms.js"/></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/selenium-core/scripts/selenium-browserbot.js"></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/jsunit/app/jsUnitCore.js"></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/preferences.js"></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/tools.js"></script>
		<script type="text/javascript" src="chrome://selenium-ide/content/testSuiteProgress.js"></script>
		<script type="text/javascript">
function setUp() {
    window.progress = new TestSuiteProgress("testProgress");
}

function testShouldUpdate() {
    progress.update(10, 100, false);
    assertEquals("10", $("testProgressIndicator").getAttribute("flex"));
    assertEquals("90", $("testProgressIndicator2").getAttribute("flex"));
    assertEquals("success", $("testProgressIndicator").getAttribute("class"));
    assertEquals("10", $("testProgressRuns").value);
    assertEquals("0", $("testProgressFailures").value);
    progress.update(11, 100, true);
    assertEquals("failure", $("testProgressIndicator").getAttribute("class"));
    assertEquals("11", $("testProgressRuns").value);
    assertEquals("1", $("testProgressFailures").value);

    progress.reset();
    assertEquals("0", $("testProgressIndicator").getAttribute("flex"));
    assertEquals("100", $("testProgressIndicator2").getAttribute("flex"));
    assertEquals("success", $("testProgressIndicator").getAttribute("class"));
    assertEquals("0", $("testProgressRuns").value);
    assertEquals("0", $("testProgressFailures").value);
}
</script>
  </head>
  <body>
    <div id="testProgressBar">
      <div id="testProgressIndicator" />
      <div id="testProgressIndicator2" />
    </div>
    <input type="text" id="testProgressRuns" />
    <input type="text" id="testProgressFailures" />
  </body>
</html>
